<?php
 
my_component_load('testing' , false);
my_component_load('paging' , false);  
my_component_load('xl_builder' , false);  
my_component_load('list_kalender' , false);    
my_component_load('pr_validasi' );
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$karyawan_id= isset( $_GET['karyawan_id'] ) ? $_GET['karyawan_id']:  0;
$komponen_id= isset( $_GET['komponen_id'] ) ? $_GET['komponen_id']:  0;
$t_id= isset( $_GET['t_id'] ) ? $_GET['t_id']:  0;

$modulname = "Penggajian _BN_   Konfirmasi hasil proses gaji";
if($_SERVER["REQUEST_METHOD"] == "POST" ){

}else{
	if($task =='detail'){
		$pagename = $modulname." _BN_ Detail";
		load_facebox_script();
		$view =  list_validasi_detail($karyawan_id);
	}elseif($task =='detail_absen'){
		$pagename = $modulname." _BN_ Detail Absen";
		load_facebox_script();
		$view =  list_detail_absen($karyawan_id);
	}elseif($task =='detail_premi'){
		$pagename = $modulname." _BN_ Detail Premi";
		load_facebox_script();
		$view =  list_detail_premi($karyawan_id);
	}elseif($task =='list_transaksi'){
		$pagename = $modulname." _BN_ Detail";
		load_facebox_script();
		$view =  list_transaksi($karyawan_id, $t_id);		
	}elseif($task == 'list_komponen_excel'){
		header("Content-Type: application/xls");
		header("Content-Disposition: attachment;filename=kalkulasi_all_komponen.xls");
		echo list_komponen_export_excel();
		exit;
	}elseif($task == 'list_komponen'){
		$pagename = $modulname." _BN_ Detail";
		load_facebox_script();
		$view =  list_komponen();
	}elseif($task == 'list_komponen_thp_excel'){
		header("Content-Type: application/xls");
		header("Content-Disposition: attachment;filename=kalkulasi_thp.xls");
		echo list_komponen_thp_excel($komponen_id);
		exit;
	}elseif($task == 'list_komponen_gaji_excel'){
		header("Content-Type: application/xls");
		header("Content-Disposition: attachment;filename=kalkulasi_gaji.xls");
		echo list_komponen_gaji_excel($komponen_id);
		exit;
	}elseif($task == 'list_komponen_detail_excel'){
		$item_name = my_get_data_by_id('pr_komponen_gaji','komponen_gaji_id',$komponen_id);
		header("Content-Type: application/xls");
		header("Content-Disposition: attachment;filename=kalkulasi_".strtolower(str_replace(" ","_",$item_name['nama_komponen_gaji'])).".xls");
		echo list_komponen_detail_excel($komponen_id);
		exit;
	}elseif($task == 'list_komponen_detail'){
		$pagename = $modulname." _BN_ Detail";
		load_facebox_script();
		if( $komponen_id == 0)
			$view =list_komponen_thp();
		elseif( $komponen_id == 1000 )
			$view =list_komponen_gaji();
		else
			$view =  list_komponen_detail($komponen_id);
	}else{
		$pagename = $modulname ;
		load_facebox_script();	
		$view = list_validasi();
	}
}	
generate_my_web($view, $pagename );

?>

